﻿using UnityEngine;
using System.Collections;

public class MapScrolling : MonoBehaviour
{

    public Transform list;
	
	// Update is called once per frame
	void Update () {
        if (transform.localPosition.y > 10 )
        {
            //list.gameObject.SetActive(true);
            list.GetComponent<tk2dUIScrollableArea>().enabled = false;
            transform.localPosition = new Vector3(transform.localPosition.x, 10, transform.localPosition.z);
        }
        else { list.GetComponent<tk2dUIScrollableArea>().enabled = true; }
        

        if( transform.localPosition.y<-1)
        {
            //list.gameObject.SetActive(true);
            list.GetComponent<tk2dUIScrollableArea>().enabled = false;
            transform.localPosition = new Vector3(transform.localPosition.x, -1, transform.localPosition.z);
        }
	}
}
